# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidPublisher.V3.Model.MigrateBasePlanPricesRequest do
  @moduledoc """
  Request message for MigrateBasePlanPrices.

  ## Attributes

  *   `basePlanId` (*type:* `String.t`, *default:* `nil`) - Required. The unique base plan ID of the base plan to update prices on.
  *   `latencyTolerance` (*type:* `String.t`, *default:* `nil`) - Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.
  *   `packageName` (*type:* `String.t`, *default:* `nil`) - Required. Package name of the parent app. Must be equal to the package_name field on the Subscription resource.
  *   `productId` (*type:* `String.t`, *default:* `nil`) - Required. The ID of the subscription to update. Must be equal to the product_id field on the Subscription resource.
  *   `regionalPriceMigrations` (*type:* `list(GoogleApi.AndroidPublisher.V3.Model.RegionalPriceMigrationConfig.t)`, *default:* `nil`) - Required. The regional prices to update.
  *   `regionsVersion` (*type:* `GoogleApi.AndroidPublisher.V3.Model.RegionsVersion.t`, *default:* `nil`) - Required. The version of the available regions being used for the regional_price_migrations.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :basePlanId => String.t() | nil,
          :latencyTolerance => String.t() | nil,
          :packageName => String.t() | nil,
          :productId => String.t() | nil,
          :regionalPriceMigrations =>
            list(GoogleApi.AndroidPublisher.V3.Model.RegionalPriceMigrationConfig.t()) | nil,
          :regionsVersion => GoogleApi.AndroidPublisher.V3.Model.RegionsVersion.t() | nil
        }

  field(:basePlanId)
  field(:latencyTolerance)
  field(:packageName)
  field(:productId)

  field(:regionalPriceMigrations,
    as: GoogleApi.AndroidPublisher.V3.Model.RegionalPriceMigrationConfig,
    type: :list
  )

  field(:regionsVersion, as: GoogleApi.AndroidPublisher.V3.Model.RegionsVersion)
end

defimpl Poison.Decoder, for: GoogleApi.AndroidPublisher.V3.Model.MigrateBasePlanPricesRequest do
  def decode(value, options) do
    GoogleApi.AndroidPublisher.V3.Model.MigrateBasePlanPricesRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AndroidPublisher.V3.Model.MigrateBasePlanPricesRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
